#include "MediaFramePool.h"
#include "Poco/Notification.h"

using Poco::Notification;

namespace cm_media
{
    MediaFramePool::MediaFramePool()
    {

    }

    MediaFramePool::~MediaFramePool()
    {

    }

    void MediaFramePool::put(ByteBuffer* pb)
    {
        m_queue.enqueueNotification((Notification*)pb);
        notifyObservers();
    }

    NotificationCenter* MediaFramePool::getNotificationCenter()
    {
        return m_nc;
    }

    void MediaFramePool::notifyObservers()
    {
        if( m_nc ){
            m_nc->postNotification( new MediaFramePoolNotification );
        }
    }

}